def fn(n):
    for i in range(n):
        for j in range(n-i-1):
            print("    ", end='')
        for j in range(i+1,0,-1):
            print("%4.d"%j,end='')
        print()
    print("\n-----------------------------------------------------------------------------------\n")
    for i in range(n):
	#for j in range(i,0,-1):
        #    print("    ",end='')
        #for j in range(n-i,0,-1):
        #    print("%4.d"%j,end='')
        for j in range(n,0,-1):
            print("%4.d"%j,end='') if n-i>=j else print("    ",end='')   #观察学习其他同学作业做出修改
        print()
    return 0

fn(int(input("请输入参数n:")))


# 空格宽度没有做到统一
